<?php

namespace Modules\ShopApi\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AddCartRequest extends FormRequest
{
    
      
    public function authorize()
    {
        return true;
    }
	public function rules()
    {
        return [
			'product_id' 	=> 'required|is_positive_integer',
			'num' 			=> 'required|is_positive_integer',
			'specs_id' 		=> 'required|is_positive_integer',
			
        ]; 
    }  
	public function messages(){   
		return [
			'product_id.required' 				=> '缺少参数（product_id）！',
			'product_id.is_positive_integer' 	=> 'product_id格式错误！',
			'num.required' 						=> '缺少参数（num）！',
			'num.is_positive_integer' 			=> 'num格式错误！',
			'specs_id.required' 				=> '缺少参数（specs_id）！',
			'specs_id.is_positive_integer' 		=> 'specs_id格式错误！',
		];
	}
}









